import Vue from 'vue';
import VueRouter from 'vue-router';
import organization from './organization';
import store from './../store'
let childrenPath = [
    // {
    // 	path: 'test',
    // 	name: 'test',
    // 	meta: {
    // 		index: 1,
    // 		title: 'test'
    // 	},
    // 	component: () => import(/* webpackChunkName: 'rsa' */'@/pages/testRsa')
    // },
    // {
    // 	path: 'test_jump',
    // 	name: 'test_jump',
    // 	meta: {
    // 		index: 2,
    // 		title: 'test_jump'
    // 	},
    // 	component: () => import(/* webpackChunkName: 'rsa' */'@/pages/testRsa/jump')
    // },
]
let path = {...organization, }
for (let i in path) {
    childrenPath.push(path[i])
}

export default new VueRouter({
    mode: 'hash',
    routes: [{
            path: '/',
            meta: {
                index: 0,
                title: store.state.projectName+"互联网医院"
            },
            redirect: '/login'
        },
        {
            path: '/index',
            name: 'index',
            meta: {
                index: 1,
                title: store.state.projectName+"互联网医院"
            },
            component: () =>
                import ( /* webpackChunkName: 'index' */ '@/pages/index/index'),
            children: childrenPath,
        },
        {
            path: '/statisticaloverviewscreen',
            name: 'bigoverview',
            meta: {
                index: 3,
                title: "家医签约概览"
            },
            component: () =>
                import ( /* webpackChunkName: 'login' */ '@/pages/familyDoctor/statisticaloverviewscreen')
        },
        {
            path: '/nucleAcidmonitor',
            name: 'nucleAcidmonitor',
            meta: {
                index: 3,
                title: ""
            },
            component: () =>
                import ( /* webpackChunkName: 'login' */ '@/pages/nucleicacid/missionMonitoring/nucleAcidmonitor')
        },
        {
            path: '/login',
            name: 'login',
            meta: {
                index: 1,
                title: "登陆"
            },
            component: () =>
                import ( /* webpackChunkName: 'login' */ '@/pages/login')
        },
        {
            path: '/changerpass',
            name: 'changerpass',
            meta: {
                index: 1,
                title: "修改密码"
            },
            component: () =>
                import ( /* webpackChunkName: 'login' */ '@/pages/changerpass/')
        },
        {
            path: '/home',
            name: 'home',
            meta: {
                index: 1,
                title: store.state.platformName
            },
            component: () =>
                import ( /* webpackChunkName: 'login' */ '@/pages/home')
        },
        {
            path: '/public',
            name: 'publicmodel',
            meta: {
                index: 1,
                title: "公共平台"
            },
            component: () =>
                import ( /* webpackChunkName: 'rsa' */ '@/pages/public'),
        },
        {
            path: '*',
            name: '404',
            meta: {
                index: 1,
                title: "404 NOT FOUND"
            },
            component: () =>
                import ( /* webpackChunkName: 'not-found' */ '@/pages/public/404')
        }
    ]
});